<!--
 * @Author: your name
 * @Date: 2020-09-22 17:23:28
 * @LastEditTime: 2021-02-02 09:21:57
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \longh_admin\src\components\GlobalHeader\RightContent.vue
-->
<template>
  <div :class="wrpCls">
    <avatar-dropdown :menu="showMenu" :current-user="currentUser" :class="prefixCls" />
    <!-- <select-lang :class="prefixCls" /> -->
  </div>
</template>

<script>
import AvatarDropdown from './AvatarDropdown'
import SelectLang from '@/components/SelectLang'

export default {
  name: 'RightContent',
  components: {
    AvatarDropdown,
    SelectLang
  },
  props: {
    prefixCls: {
      type: String,
      default: 'ant-pro-global-header-index-action'
    },
    isMobile: {
      type: Boolean,
      default: () => false
    },
    topMenu: {
      type: Boolean,
      required: true
    },
    theme: {
      type: String,
      required: true
    }
  },
  data () {
    return {
      showMenu: true,
      currentUser: {},
    username:'',
    }
  },
  watch: {
    f1(curVal, oldVal) {
      if (curVal) {
        this.username = this.$store.state.info;
      } else {
        this.username = this.$store.state.info;
      }
      //这里的curVal就是需要监听的值
    },
  
  },
  computed: {
    f1() {
      return this.$store.state.user.info;
    },
    wrpCls () {
      return {
        'ant-pro-global-header-index-right': true,
        [`ant-pro-global-header-index-${(this.isMobile || !this.topMenu) ? 'light' : this.theme}`]: true
      }
    }
  },
  mounted () {
    setTimeout(() => {
      this.currentUser = {
        name: this.$store.state.user.info
      }
    }, 1500)
  }
}
</script>
